\documentclass[a4paper,10pt]{article}

\usepackage{uml}

\title{A small sample \dots}
\author{My, myself, and I}
\date{\today}

\begin{document}
\maketitle
\tableofcontents


%\normalfont

\begin{figure}
\centering
\scriptsize
\ttfamily

\umlDiagram[box=,border,sizeX=16cm,sizeY=20cm,ref=diagram]{%
  \umlClass[reference=Samochod, refpoint=tm, pos=\umlTop{diagram}, posDelta={0,-2}]{Samochod}{%
      \umlAttribute[visibility=-, type=String]{numerRejestracyjny}
      \umlAttribute[visibility=-, type=int]{rokProdukcji}
   }{%
      \umlMethod[visibility=+, returntype=float]{metoda}{String numer, int rok}
      \umlMethod[visibility=\$, returntype=float]{obliczSpalanie(float paliwo, float km)}{}
  }
  \umlClass[reference=Parking, refpoint=bm, pos=\umlBottom{diagram}, posDelta={0,2}]{Parking}{%
      \umlAttribute[visibility=-, type=Samochod{$[]$}]{miejsca}
   }{%
      \umlMethod[visibility=+, ]{Parking}{int miejsca}
      \umlMethod[visibility=+, returntype=int]{zaparkuj(Samochod samochod)}{}
      \umlMethod[visibility=+, returntype=Samochow]{zwolnij}{int miejsce}
      \umlMethod[visibility=+, returntype=int]{ileWolnychMiejsc}{}
      \umlMethod[visibility=+, returntype=void]{podglad}{}
  }


  \umlClass[reference=Chromosome, refpoint=tl, pos=\umlTop{diagram}, posDelta={-10,0}]{Chromosome}{%
      \umlAttribute[visibility=+ , type=bool]{minimize}
      \umlAttribute[visibility=\# , type=double]{fitness}
   }{%
      \umlMethod[visibility=+]{~Chromosome}{}%_&# <<
  \umlMethod[visibility=+, returntype=Chromosome\&]{operator=}{const Chromosome\& other}
  \umlMethod[visibility=+, returntype=void]{setFitness}{double \_fitness}
  \umlMethod[visibility=+, returntype=double]{getFitness}{}
  \umlMethod[visibility=+, returntype=void]{setRandom}{}
  \umlMethod[visibility=+, returntype=void]{crossOver}{const Chromosome\& partner}
  \umlMethod[visibility=+, returntype=void]{mutate}{}
  \umlMethod[visibility=+, returntype=void]{mutate}{int index}
  \umlMethod[visibility=+, returntype=void]{additionalOperators}{int position}
  \umlMethod[visibility=+, returntype=void]{additionalOperators}{const Chromosome\& second}
  \umlMethod[visibility=+, returntype=bool]{operator<}{const Chromosome\& other}
  \umlMethod[visibility=+, returntype=bool]{operator==}{const Chromosome\& other}
  \umlMethod[visibility=+, returntype=QString]{toString}{}
  \umlMethod[visibility=+, returntype=Chromosome*]{duplicate}{}
  \umlMethod[visibility=+, returntype=QVariant]{at}{int index}
  \umlMethod[visibility=+, returntype=QVariant]{data}{}
  \umlMethod[visibility=+, returntype=int]{size}{}
  \umlMethod[visibility=+, returntype=bool]{greaterThan}{const Chromosome* chr1, const Chromosome* chr2}
  \umlMethod[visibility=+, returntype=QDebug]{operator$<<$}{QDebug dbg, const Chromosome\& chr}
  \umlMethod[visibility=\#]{Chromosome}{}
  \umlMethod[visibility=\#]{Chromosome}{const Chromosome\& other}
  }

  \umlClass[reference=BinaryChromosome, refpoint=tl, pos=\umlTop{diagram}, posDelta={-20,-10}]{BinaryChromosome}{%
      \umlAttribute[visibility=- , type=QBitArray]{bitArray}
   }{%
    \umlMethod[visibility=+]{BinaryChromosome}{}
    \umlMethod[visibility=+]{BinaryChromosome}{int size}
    \umlMethod[visibility=+]{BinaryChromosome}{const BinaryChromosome\& other}
    \umlMethod[visibility=+]{~BinaryChromosome}{}
    \umlMethod[visibility=+, returntype=BinaryChromosome\&]{operator$=$}{const BinaryChromosome\& other} 
    \umlMethod[visibility=+, returntype=void]{setRandom}{}
    \umlMethod[visibility=+, returntype=void]{crossOver}{const Chromosome\& partner}
    \umlMethod[visibility=+, returntype=void]{mutate}{int index}
    \umlMethod[visibility=+, returntype=bool]{operator$==$}{const Chromosome\& other} 
    \umlMethod[visibility=+, returntype=QString]{toString}{}
    \umlMethod[visibility=+, returntype=Chromosome*]{duplicate}{} 
    \umlMethod[visibility=+, returntype=QVariant]{at}{int index} 
    \umlMethod[visibility=+, returntype=QVariant]{data}{} 
    \umlMethod[visibility=+, returntype=int]{size}{} 
  }

  %\umlAggregation[ref=AB, nodesep=0ex]{Samochod}{Parking}{
  %    \umlLabelA{AB}{*}
  %    \umlLabelB{AB}{1}
  % }



}
\caption{test}
\end{figure}


\end{document}